package com.yerbe.web.user.mapper;

import com.yerbe.web.user.model.UserModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {

    @Select("select * from t_user where phone = #{phone} limit 1")
    UserModel findUserByPhone(@Param("phone") String phone);

    @Insert("insert into t_user(name, password, phone) values (#{name}, #{password}, #{phone})")
    int insert(@Param("name") String name, @Param("password") String password, @Param("phone") String phone);
}